package com.boarsoft.web.auth;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;

import com.boarsoft.auth.PowerCheck;
import com.boarsoft.bean.ReplyInfo;
import com.boarsoft.boar.auth.TokenAuth;

public class DefaultPowerCheck implements PowerCheck {
	@Autowired
	@Lazy
	private TokenAuth tokenAuth;

	@Override
	public boolean check(String id, String module) {
		ReplyInfo<Object> ro;
		try {
			ro = tokenAuth.check(id, module);
			return ro.isSuccess();
		} catch (Exception e) {
			return false;
		}
	}

}
